import { createBrowserRouter } from "react-router-dom"
import Layout from "@/pages/Layout"
import Login from '@/pages/Login'
import { lazy } from "react"


const Home = lazy(() => import('@/pages/Home'))
const Article = lazy(() => import('@/pages/Article'))
const Publish = lazy(() => import('@/pages/Publish'))

const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        index: true,
        element: <Home />
      },
      {
        path: 'article',
        element: <Article />
      },
      {
        path: 'publish',
        element: <Publish />
      }
    ]
  },
  {
    path: 'login',
    element: <Login />
  }
])
export default router
